package com.baizhi.cmfz.appcontroller;

import com.baizhi.cmfz.entity.Banner;
import com.baizhi.cmfz.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/banner")
public class BannerAppController {
    @Autowired
    private BannerService bannerService;

    @RequestMapping("/selectBanner/{count}")
    public List<Banner>selectBanner(@PathVariable("count") Integer count){

        List<Banner> data = (List<Banner>) bannerService.selectByPageBanner(1, count).get("data");
        return  data;
    }
}
